program example
use polymorphic_complextaylor
implicit none 
integer no,nv,i
type(real_8) f,g


no=4; nv= 2;  ! no: the order of the polynomial    nv: the number of variables
call init(no,nv)  ! initializes taylor series without maps

call alloc(f,g)      ! must be constructed after init

i=4
f=(2.d0.mono.'12') + (3.d0.mono.'31') + (4.d0.mono.'04') + 5.d0  
  !  Creates 2.d0 x_1 x_ 2 ^2+3.d0x_1^3x_2+4.d0x_2^4 + 5.d0
g=f.sub.i        !  Creates 3.d0x_1^3x_2+4.d0x_2^4

call print(f,6)
call print(g,6)



i=0
f=(2.d0.mono.'12') + (3.d0.mono.'31') + (4.d0.mono.'04') + 5.d0  
  !  Creates 2.d0 x_1 x_ 2 ^2+3.d0x_1^3x_2+4.d0x_2^4 + 5.d0
g=f.sub.i        !  Creates 5.d0 as a Taylor series !!!!!!!!!!!!!!!!!!!!!!!!!!!

call print(f,6)
call print(g,6)


!      <-------------    Example added    
i=4
f=6.d0  
g=f.sub.i        !   Returns zero as a Taylor seires 

call print(f,6)
call print(g,6)


i=0
f=6.d0  
g=f.sub.i        !   Creates 6.d0 as a Taylor seires  <------- comment changed

call print(f,6)
call print(g,6)

call kill(f,g)      ! must be destroyed




end program example